

class Send_mess:
    def __init__(self):
        self.action=[]
        self.data=[]
        self.command=[]

    def to_string(self):
        # 转换为通信对应的字符串
        message_command=''
        message_data=''
        message_action=''
        for i in self.action:
            message_action+='&'+i
        for j in self.command:
            message_command+='&'+j
        for k in self.data:
            message_data+='&'+k
        message='Command:{0};Data:{1};Actor:{2};\r\n'.format(
            message_command,message_data,message_action)
        return message


    def set_action(self,action):
        self.action.append(str(action))

    def set_command(self,command):
        self.command.append(str(command))

    def set_data(self,data):
        self.data.append(str(data))

    def clean(self):
        self.action=[]
        self.data=[]
        self.command=[]